/** \file    refine/smooth.h
  * \brief   Construct smooth grey mask from existing bit mask for the object.
  * \date    2004
  * \author  Fedor Chelnokov
  * \version $Header: /home/cscom1r4/cvsroot/cs/include/refine/smooth.h,v 1.5 2005/06/25 18:49:42 cscom1r4 Exp $
  */

#ifndef _refine_smooth_h_
#define _refine_smooth_h_

#include "types.h"

namespace refine {

namespace smooth {

enum information {
	info_mean,
	info_mean_and_dispersion
};

struct params {
	int window_half_size;
	bool cluster;
	information consider;
	bool has_initial_apprx; ///< some grey mask is provided and it must be only modified
	bool monotone;
	bool silent;
};

extern params const default_params;

void perform(const byte_image & src, const bit_mask::mask & m, grey_mask::mask & s, const params & p = default_params);
void perform(const argb_byte_image & src, const bit_mask::mask & m, grey_mask::mask & s, const params & p = default_params);

///(r,g,b) channels are source images that will be unchanged
///alpha channel will receive smoothed mask
void perform(byte_image & img, const bit_mask::mask & m, const params & p = default_params);
void perform(argb_byte_image & img, const bit_mask::mask & m, const params & p = default_params);

} //namespace smooth

} //namespace refine

#endif //_refine_smooth_h_
